#!/bin/sh

STA="wlan1"
insmod /lib/modules/8188eu.ko
sleep 3
ifconfig $STA up
sleep 3
mkdir -p /var/run/wpa_supplicant
wpa_supplicant -i $STA -c /etc/wpa_supplicant.conf -B
if [ $? -eq 0 ]
then
	udhcpc -i $STA
	echo "==========STA mode init success========="
	sysctl -w net.ipv4.ip_forward=1
	iptables -t nat -A POSTROUTING -o $STA -j MASQUERADE
	iptables -A FORWARD -i br0 -o $STA -j ACCEPT
fi

